package com.igeek.boot.mapper;

import com.igeek.boot.entity.Permission;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Set;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author
 * @since 2023-12-26
 */
@Mapper
public interface PermissionMapper extends BaseMapper<Permission> {

    //根据角色id查询权限列表
    @Select("select p.* from permission p,role_permission rp where p.id=rp.permission_id and rp.role_id=#{roleId}")
    public Set<Permission> selectPermissionsByRoleId(Integer roleId);

}
